package com.shsoft.entity;

import oshi.SystemInfo;

import java.text.DecimalFormat;
import java.util.Calendar;

public class HardWareInfo {

    public static boolean refreshAll = true;

    public static DecimalFormat df = new DecimalFormat("0.0");

    public static SystemInfo systemInfo = new SystemInfo();

    public static float netUploadSpeed;

    public static float netDownloadSpeed;

    public static String cpuName = "";

    public static int cpuBaseClock;

    public static int cpuClockCur,cpuClockMin,cpuClockMax;

    public static int cpuUsageCur,cpuUsageMin,cpuUsageMax;

    public static int cpuTempCur,cpuTempMin,cpuTempMax;

    public static float cpuPowerCur,cpuPowerMin,cpuPowerMax;

    public static String memName = "";

    public static int memUsed;

    public static int memClock;

    public static String gpuName = "";

    public static int gpuTempCur,gpuTempMin,gpuTempMax;

    public static int gpuUsageCur,gpuUsageMin,gpuUsageMax;

    public static int gpuClockCur,gpuClockMin,gpuClockMax;

    public static float gpuPowerCur,gpuPowerMin,gpuPowerMax;

    public static int gpuUsedMemory;

    public static int gpuFreeMemory;

    public static int gpuTotalMemory;

    public static int gpuFanSpeed;

    public static int cityTemp,cityHum,cityAqi;

    public static String cityWeatherText,cityName;

    public static Calendar calendar;

    public static String getYear(){
        return calendar.get(Calendar.YEAR) + "";
    }
    public static String getMonth(){
        int month = calendar.get(Calendar.MONTH) + 1;
        if(month < 10){
            return "0" + month;
        }
        return month + "";
    }
    public static String getDay(){
        int day = calendar.get(Calendar.DAY_OF_MONTH);
        if(day < 10){
            return "0" + day;
        }
        return day + "";
    }
    public static String getHour(){
        int hour = calendar.get(Calendar.HOUR_OF_DAY);
        if(hour < 10){
            return "0" + hour;
        }
        return hour + "";
    }
    public static String getMinute(){
        int minute = calendar.get(Calendar.MINUTE);
        if(minute < 10){
            return "0" + minute;
        }
        return minute + "";
    }
    public static String getSecond(){
        int second = calendar.get(Calendar.SECOND);
        if(second < 10){
            return "0" + second;
        }
        return second + "";
    }
    public static String getWeek(){
        int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
        switch (dayOfWeek){
            case Calendar.SUNDAY:
                return "周日";
            case Calendar.MONDAY:
                return "周一";
            case Calendar.TUESDAY:
                return "周二";
            case Calendar.WEDNESDAY:
                return "周三";
            case Calendar.THURSDAY:
                return "周四";
            case Calendar.FRIDAY:
                return "周五";
            case Calendar.SATURDAY:
                return "周六";
            default:
                return "";
        }
    }

}
